/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

const machineManagementRouter =  {
  path: '/machinemanagement',
  component: Layout,
  redirect: '/machinemanagement/machine/list',
  alwaysShow: true,
  name: 'Machine Management',
  meta: {
    title: '仪器预约与管理',
    icon: 'form'
  },
  children: [
    {
      path: '/machine',
      component: () => import('@/views/machine-management/machine/index'),
      redirect: '/machinemanagement/machine/list',
      children: [
        {
          path: 'create',
          component: () => import('@/views/machine-management/machine/Create'),
          name: 'CreateMachine',
          hidden: true,
          meta: { title: '新增仪器',
            permission: "仪器信息：创建",
          }
        },
        {
          path: 'edit/:id(\\d+)',
          component: () => import('@/views/machine-management/machine/Edit'),
          name: 'EditMachine',
          meta: { title: '编辑仪器信息',
            permission: "仪器信息：更新",
            noCache: true, activeMenu: '/machine/list',
          },
          hidden: true
        },
        {
          path: 'view/:id(\\d+)',
          component: () => import('@/views/machine-management/machine/View'),
          name: 'ViewMachine',
          meta: { title: '查看仪器信息', noCache: true, activeMenu: '/machine/view',
            permission: "仪器信息：浏览", 
          },
          hidden: true
        },
        {
          path: 'list',
          component: () => import('@/views/machine-management/machine/List'),
          name: 'MachineList',
          meta: { title: '仪器信息管理',
            permission: "仪器信息：浏览",
          }
        }
      ]
    },
    {
      path: '/machineappointment',
      component: () => import('@/views/machine-management/machine-appointment/index'),
      redirect: '/machinemanagement/machineappointment/list',
      children: [
        {
          path: 'create',
          component: () => import('@/views/machine-management/machine-appointment/Create'),
          name: 'CreateMachineAppointment',
          hidden: true,
          meta: { title: '新增仪器预约',
            permission: "仪器预约信息：创建",
          }
        },
        {
          path: 'edit/:id(\\d+)',
          component: () => import('@/views/machine-management/machine-appointment//Edit'),
          name: 'EditMachineAppointment',
          meta: { title: '编辑仪器预约信息', noCache: true, activeMenu: '/machineappointment/list',
            permission: "仪器预约信息：更新",
          },
          hidden: true
        },
        {
          path: 'view/:id(\\d+)',
          component: () => import('@/views/machine-management/machine-appointment/View'),
          name: 'ViewMachineAppointment',
          meta: { title: '查看仪器预约信息',
            permission: "仪器预约信息：浏览",
            noCache: true, activeMenu: '/machineappointment/view',
          },
          hidden: true
        },
        {
          path: 'check/:id(\\d+)',
          component: () => import('@/views/machine-management/machine-appointment/Check'),
          name: 'CheckMachineAppointment',
          meta: { title: '查看仪器预约信息',
            permission: "仪器预约信息：浏览",
            noCache: true, activeMenu: '/machineappointment/check',
          },
          hidden: true
        },
        {
          path: 'list',
          component: () => import('@/views/machine-management/machine-appointment/List'),
          name: 'MachineAppointmentList',
          meta: { title: '仪器预约',
            permission: "仪器预约信息：浏览",
          }
        }
      ]
    }
  ]
}

export default machineManagementRouter
